home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 17
/
CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso
/
CUCD
/
Programming
/
DiceSource
/
lib
/
extra
/
resource.a
< prev
next >
Wrap
Text File
|
1994-02-01
|
1KB
|
57 lines
; EXEC resource support
; 4(sp) 8(sp)
; AutoAllocMiscResource(resno, value)
; resno: MR_SERIALPORT, SERIALBITS, PARALLELPORT, PARALLELBITS
; value: -1 to allocate, 0 to check
;
; returns 0 on success
;
; AutoFreeMiscResource(resno)
; 4(sp)
; Free a misc resource you allocated
;
; No need to open the misc.resource
section text,CODE
xdef _AutoAllocMiscResource
xdef _AutoFreeMiscResource
xref _LVOOpenResource
_AutoAllocMiscResource:
move.l A6,-(sp)
bsr OpenMiscResource
beq amfail
move.l 8(sp),D0
move.l 12(sp),A1
jsr -6(A6)
bra amret
amfail moveq.l #-1,D0
amret move.l (sp)+,A6
rts
_AutoFreeMiscResource:
move.l A6,-(sp)
bsr OpenMiscResource
beq fmret
move.l 8(sp),D0
jsr -12(A6)
fmret move.l (sp)+,A6
rts
OpenMiscResource:
move.l 4,A6
lea.l MiscName(pc),A1
jsr _LVOOpenResource(A6)
move.l D0,A6
tst.l D0
rts
MiscName: dc.b $6D,$69,$73,$63,$2E,$72,$65,$73,$6F,$75,$72,$63,$65,$00
END